package cn.tedu.submarine;

import javax.swing.*;
import java.awt.*;

//深水炸弹
public class Bomb extends SeaObject{
    //构造方法
    public Bomb(int x,int y){
        super(9,12,x,y,3);
    }

    @Override
    public void move() {
        y+=speed;//y+(向下)
    }

    //重写getImage()获取图片
    public ImageIcon getImage() {
        return Images.bomb;//返回深水炸弹
    }

    /**检测isOutOfBounds()是否越界*/
    public boolean isOutOfBounds(){
        return y>=World.HEIGHT;//深水炸弹的y>=窗口的高,即为越界
    }
}
